package test.luin.pers.myapplication;

import android.content.Context;
import android.content.SharedPreferences;

import java.util.HashMap;
import java.util.Map;

public class SaveFileQQ {
    public static boolean saveUserInfor(Context context, String userid, String psssword) {
        SharedPreferences preferences = context.getSharedPreferences("data", context.MODE_PRIVATE);
        SharedPreferences.Editor editor = preferences.edit();
        editor.putString("userid", userid);
        editor.putString("psssword", psssword);
        editor.commit();
        return true;
    }

    public static Map<String, String> getUserInfor(Context context) {
        SharedPreferences preferences = context.getSharedPreferences("data", context.MODE_PRIVATE);
        String userid = preferences.getString("userid", "");
        String psssword = preferences.getString("psssword", "");
        Map<String, String> map = new HashMap<>();
        map.put("username", userid);
        map.put("password", psssword);
        return map;
    }
}
